package com.hwh.controller;

import java.io.IOException;
import java.util.ArrayList;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import com.hwh.service.StoresService;
import com.hwh.serviceIm.StoresServiceImpl;
import com.hwh.vo.Stores;

public class SelAllStoreController extends HttpServlet {

	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		super.doPost(req, resp);
	}

	protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

		ArrayList<Stores> stores = new ArrayList<Stores>();
		StoresService os = new StoresServiceImpl();

		stores = os.getStores();

		// 将stores对象放入session中,前台用EL表达式获取值
		HttpSession session = req.getSession();

		session.setAttribute("stores", stores);

		req.getRequestDispatcher("astores.jsp").forward(req, resp);

	}

}
